package mka.puzzle.shape;

import java.util.ArrayList;

public class ShapeList {
	private ArrayList<Shape> shapeList;

	/**
	 * Constructor(ShapeList())
	 */
	public ShapeList() {
		super();
		this.shapeList = new ArrayList<Shape>();
	}
	
	/**
	 * Constructor(ShapeList(ArrayList<Shape> shapeList))
	 */
	public ShapeList(ArrayList<Shape> shapeList) {
		super();
		this.shapeList = shapeList;
	} 

	/**
	 * getShapeList
	 * 
	 * @return ArrayList<Shape>
	 */
	public ArrayList<Shape> getShapeList() {
		return shapeList;
	}

	/**
	 * setShapeList
	 * 
	 * @param shapeList
	 *            ArrayList<Shape>
	 */
	public void setShapeList(ArrayList<Shape> shapeList) {
		this.shapeList = shapeList;
	}

	/**
	 * getLength
	 * 
	 * @return integer
	 */
	public int getLength() {
		return shapeList.size();
	}

	/**
	 * addShape
	 * 
	 * @param shape
	 *            Shape
	 */
	public void addShape(Shape shape) {
		shapeList.add(shape);
	}

	/**
	 * deleteShape
	 * 
	 * @param shape
	 *            Shape
	 */
	public void deleteShape(Shape shape) {
		for (Shape s : shapeList) {
			if (s.equals(shape)) {
				shapeList.remove(s);
			}
		}
	}
}
